#include <iostream>
using namespace std;

const int maxsize = 100000;

int main() {
    int n; cin >> n;
    for (int i = 0; i < n; i ++) {
        int m; cin >> m;
        int mylist[maxsize];
        int count_down = 0, count_up = 0, count_zero = 0;
        for (int j = 0; j < m; j ++) {
            cin >> mylist[j];
            if (mylist[j] == 1) count_up ++;
            else if (mylist[j] == -1) count_down ++;
            else count_zero ++;
        }
        int ans = 0;
        if (count_down >= count_up) { //集体向负数倾倒
            ans += 2 * count_up;
            ans += count_zero;
        }
        else {                        //集体向正数倾倒
            ans += 2 * count_down;
            ans += count_zero;
        }
        cout << ans << endl;
    }
    return 0;
}